package com.gz.dto;

import com.gz.utils.DataFmtUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

@Data
@ApiModel(value = "查询最近科目错题入参")
public class RecentFaultDto {
    @ApiModelProperty("用户id")
    private String userId;
    @ApiModelProperty("科目")
    private String subject;
    @ApiModelProperty("学层")
    private String level;
    @ApiModelProperty("年级")
    private String grade;
    @ApiModelProperty("排序字段")
    private String orderField;
    @ApiModelProperty("排序类型")
    private String orderType;

    public String getOrderField() {
        if (!StringUtils.isEmpty(orderField)) {
            return DataFmtUtil.xX2x_x(orderField);
        }
        return orderField;
    }
}
